using System.Runtime.Serialization;

namespace SharedObjects
{
	[DataContract] 
	[ReferencedBy(typeof(Gateway))]
	public class GatewayBlueprint : EntityBase, IHardware
	{
		[DataMember] public bool IsDefault { get; set; }
		[DataMember] public long BasePrice { get; set; }
		[DataMember] public string Name { get; set; }
		[DataMember] public int MinimumMarketDifficulty { get; set; }
		[DataMember] public double Modifier { get; set; } //not used for blueprint

		[DataMember] public int NumMemorySlots { get; set; }
		[DataMember] public int NumCpuSlots { get; set; }
		[DataMember] public int NumNicSlots { get; set; }
		
		[DataMember] public int MaxMemorySize { get; set; }
		[DataMember] public double MaxCpuSpeed { get; set; }
		[DataMember] public double MaxBandwidth { get; set; }

		[DataMember] public int MaxAllowedMemorySize { get; set; }
		[DataMember] public double MaxAllowedCpuSpeed { get; set; }
		[DataMember] public double MaxAllowedBandwidth { get; set; }

		public string GetDescription()
		{
			string desc = string.Format(@"Mainboard specs:

Max Speed/CPU: {0}
# of CPU sockets: {1}

Max Size/Mem: {2}
# of Mem slots: {3}

Max Speed/NIC: {4}
# of NIC slots: {5}",
				MaxAllowedCpuSpeed, NumCpuSlots, MaxAllowedMemorySize, NumMemorySlots, MaxAllowedBandwidth, NumNicSlots);
			return desc;
		}
	}
}